package com.himiotech.core.project.web.base;

import cn.hutool.core.util.StrUtil;
import com.himiotech.core.framework.helper.utils.ShiroUtils;
import com.himiotech.core.project.model.entity.user.User;

class SessionBaseController extends DataReqBaseController {

    /**
     * 页面跳转
     */
    protected static String redirect(String url) {
        return StrUtil.format("redirect:{}", url);
    }

    protected User getSysUser() {
        return ShiroUtils.getSysUser();
    }

    protected void setSysUser(User user) {
        ShiroUtils.setSysUser(user);
    }

    protected Long getUserId() {
        return getSysUser().getUserId();
    }

    protected String getLoginName() {
        return getSysUser().getLoginName();
    }
}
